<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_810097_s50gcn082go.css">
    <link rel="stylesheet" href="../../css/common/reset.css">
    <link rel="stylesheet" href="../../css/setGoodCt.css">
    <!-- <script src="../../js/layui.all.js"></script> -->
    <!-- <link rel="stylesheet" href="../../layui/css/layui.css"> -->
</head>

<body style="background: #fff;">
    <form class="layui-form">
        <!-- <ul>
            <li>
                <p class="fl labelText">选择评价类型：</p>
                <div class="fl tabPjTypeBox">
                    <label class="fTextGoodHp">
                        <input type="radio">文字好评<span class="redColor">1.5</span>个发布点
                    </label>
                    <label class="fPhotoGoodHp">
                        <input type="radio">晒图好评<span class="redColor">3.00</span>个发布点
                    </label>
                </div>
            </li>
        </ul> -->
        <div class="showContent">
            <div class="textGoodBox open">
                <ul>
                    <li>
                        <p class="fl labelText">设置好评内容：</p>
                        <p class="fl">
                            <textarea name="" id="defaultHighPraise" placeholder="请输入6~500个字符的评价内容"></textarea>
                        </p>
                    </li>
                    <!-- <li>
                        <p class="fl labelText">身份验证：</p>
                        <p class="fl">
                            <input type="text" placeholder="请输入支付密码">
                        </p>
                    </li> -->
                    <li>
                        <input type="button" value="确定提交" class="btn sureBtn" lay-submit="" lay-filter="setGoodCon">
                        <!-- <input type="button" value="取消调整" class="btn editBtn"> -->
                    </li>
                </ul>
            </div>
            <div class="photoGoodBox">
                <ul>
                    <li>
                        <p class="fl labelText">设置好评内容：</p>
                        <p class="fl">
                            <textarea name="" id="" placeholder="请输入6~500个字符的评价内容"></textarea>
                        </p>
                    </li>
                    <li>
                        <p class="redColor">温馨提示：可上传1-5张的图片，图片的像素大小请控制在3M以内</p>
                    </li>
                    <li>
                        <p class="fl labelText">上传图片：</p>
                        <p class="fl">
                            <img src="http://game.gtimg.cn/images/x52/cp/a20170316taoh/add.png" alt="" class="uploadIcon">
                        </p>
                        <div class="clearfix showUploadImgs">
                            <p class="fl labelText">显示图片：</p>
                            <p class="fl imgsBox">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536078711757&di=7490a120165eda601dceb4e3754796a4&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fblog%2F201602%2F02%2F20160202183857_eYzd2.thumb.700_0.jpeg"
                                    alt="">
                            </p>
                        </div>
                    </li>
                    <li>
                        <input type="button" value="确定提交" class="btn sureBtn">
                        <!-- <input type="button" value="取消调整" class="btn editBtn"> -->
                    </li>
                </ul>
            </div>
        </div>
    </form>
    <script src="../../js/jquery.min.js"></script>
    <script src="../../layui/layui.js"></script>
    <script src="../../js/dataRequest.js"></script>
    <script>
        $(".fTextGoodHp").click(function () {
            $(".showContent .textGoodBox").addClass("open").siblings().removeClass("open");
        });
        $(".fPhotoGoodHp").click(function () {
            $(".showContent .photoGoodBox").addClass("open").siblings().removeClass("open");
        });
        function child(obj) {
            layui.use(['form', 'upload'], function () {
                var form = layui.form,
                    layer = layui.layer;
                console.log('接收数据');//获取父界面的传值
                console.log(obj);//获取父界面的传值
                console.log('接收数据');//获取父界面的传值
                // 设置好评
                form.on('submit(setGoodCon)', function (data) {
                    var defaultHighPraise = $("#defaultHighPraise").val();
                    var JdateJson = {
                        "id": obj,
                        "defaultHighPraise": defaultHighPraise
                    }
                    $.ajax({
                        type: "POST",
                        url: BASE_URL + MAP_URL + 'comment',
                        dataType: 'json',
                        contentType: "application/json;charset=utf-8",
                        data: JSON.stringify(JdateJson),
                        success: function (data) {
                            layer.msg("设置成功");
                            var index = parent.layer.getFrameIndex(window.name);
                            setTimeout(function () {
                                parent.layer.close(index);//关闭弹出层
                                parent.location.reload();//更新父级页面（提示：如果需要跳转到其它页面见下文）
                            }, 2000);
                        },
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            layer.msg("系统错误");
                        }
                    });
                    return false;
                });
            });
        }
    </script>
</body>

</html>